<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable='no'">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vuedemo2</title>
    <!-- <link rel="stylesheet" href="static/css/yidong.css"> -->
    <!-- <link rel="stylesheet" href="static/css/gwc.css"> -->
    <!-- <script src="static/js/app.js"></script> -->
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_1016724_z62fols116r.css">
  </head>
  <body>
    <div id="app">
      
    </div>
    <!-- built files will be auto injected -->
    <script>
      (function(win) {
        var docEl = win.document.documentElement;
        var time;


        function refreshRem() {
                var width = docEl.getBoundingClientRect().width;
                if (width > 768) { // 最大宽度
                        width = 768;
                }
                var rem = width / 375*100;
                docEl.style.fontSize = rem + 'px';
                ///rem用font-size:50px来进行换算


        }


        win.addEventListener('resize', function() {
                clearTimeout(time);
                time = setTimeout(refreshRem, 1);
        }, false);
        win.addEventListener('pageshow', function(e) {
                if (e.persisted) {
                        clearTimeout(time);
                        time = setTimeout(refreshRem, 1);
                }
        }, false);


        refreshRem();


      })(window);
    </script>
  </body>
</html>
